.class Lcom/nemustech/regina/ElementMaker$1;
.super Ljava/lang/Object;
.source "ElementMaker.java"

# interfaces
.implements Lcom/nemustech/tiffany/world/TFModel$JitImageProvider;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/nemustech/regina/ElementMaker;->initElementPanel(Lcom/nemustech/regina/ElementShortcut;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/nemustech/regina/ElementMaker;

.field final synthetic val$element:Lcom/nemustech/regina/ElementShortcut;


# direct methods
.method constructor <init>(Lcom/nemustech/regina/ElementMaker;Lcom/nemustech/regina/ElementShortcut;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 93
    iput-object p1, p0, Lcom/nemustech/regina/ElementMaker$1;->this$0:Lcom/nemustech/regina/ElementMaker;

    iput-object p2, p0, Lcom/nemustech/regina/ElementMaker$1;->val$element:Lcom/nemustech/regina/ElementShortcut;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public getImage(I)Landroid/graphics/Bitmap;
    .locals 4
    .parameter "faceIndex"

    .prologue
    const/4 v3, 0x0

    .line 97
    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker$1;->this$0:Lcom/nemustech/regina/ElementMaker;

    invoke-static {v1}, Lcom/nemustech/regina/ElementMaker;->access$000(Lcom/nemustech/regina/ElementMaker;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v1

    invoke-virtual {v1}, Lcom/nemustech/regina/ReginaLauncher;->getAppInfoManager()Lcom/nemustech/regina/AppInfoManager;

    move-result-object v1

    iget-object v2, p0, Lcom/nemustech/regina/ElementMaker$1;->val$element:Lcom/nemustech/regina/ElementShortcut;

    invoke-virtual {v2}, Lcom/nemustech/regina/ElementShortcut;->getIntent()Landroid/content/Intent;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/nemustech/regina/AppInfoManager;->getBitmap(Landroid/content/Intent;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 99
    .local v0, cachedBitmap:Landroid/graphics/Bitmap;
    if-eqz v0, :cond_0

    .line 100
    const-string v1, "ElementMaker"

    const-string v2, "create shortcut from cachedElementBitmap"

    invoke-static {v1, v2, v3}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 101
    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker$1;->this$0:Lcom/nemustech/regina/ElementMaker;

    invoke-static {v1}, Lcom/nemustech/regina/ElementMaker;->access$100(Lcom/nemustech/regina/ElementMaker;)Lcom/nemustech/regina/ImagePlater;

    move-result-object v1

    iget-object v2, p0, Lcom/nemustech/regina/ElementMaker$1;->val$element:Lcom/nemustech/regina/ElementShortcut;

    invoke-virtual {v2}, Lcom/nemustech/regina/ElementShortcut;->getTitle()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v0, v2}, Lcom/nemustech/regina/ImagePlater;->createShortCutImage(Landroid/graphics/Bitmap;Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v1

    .line 109
    :goto_0
    return-object v1

    .line 103
    :cond_0
    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker$1;->this$0:Lcom/nemustech/regina/ElementMaker;

    invoke-static {v1}, Lcom/nemustech/regina/ElementMaker;->access$000(Lcom/nemustech/regina/ElementMaker;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v1

    invoke-virtual {v1}, Lcom/nemustech/regina/ReginaLauncher;->getAppInfoManager()Lcom/nemustech/regina/AppInfoManager;

    move-result-object v1

    iget-object v2, p0, Lcom/nemustech/regina/ElementMaker$1;->val$element:Lcom/nemustech/regina/ElementShortcut;

    invoke-virtual {v2}, Lcom/nemustech/regina/ElementShortcut;->getIntent()Landroid/content/Intent;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Intent;->getComponent()Landroid/content/ComponentName;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/nemustech/regina/AppInfoManager;->getCachedElementBitmap(Landroid/content/ComponentName;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 104
    if-eqz v0, :cond_1

    .line 105
    const-string v1, "ElementMaker"

    const-string v2, "create shortcut from cachedBitmap"

    invoke-static {v1, v2, v3}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 106
    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker$1;->this$0:Lcom/nemustech/regina/ElementMaker;

    invoke-static {v1}, Lcom/nemustech/regina/ElementMaker;->access$100(Lcom/nemustech/regina/ElementMaker;)Lcom/nemustech/regina/ImagePlater;

    move-result-object v1

    iget-object v2, p0, Lcom/nemustech/regina/ElementMaker$1;->val$element:Lcom/nemustech/regina/ElementShortcut;

    invoke-virtual {v2}, Lcom/nemustech/regina/ElementShortcut;->getTitle()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v0, v2}, Lcom/nemustech/regina/ImagePlater;->createShortCutImage(Landroid/graphics/Bitmap;Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v1

    goto :goto_0

    .line 108
    :cond_1
    const-string v1, "ElementMaker"

    const-string v2, "create shortcut from resource"

    invoke-static {v1, v2, v3}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 109
    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker$1;->this$0:Lcom/nemustech/regina/ElementMaker;

    invoke-static {v1}, Lcom/nemustech/regina/ElementMaker;->access$100(Lcom/nemustech/regina/ElementMaker;)Lcom/nemustech/regina/ImagePlater;

    move-result-object v1

    iget-object v2, p0, Lcom/nemustech/regina/ElementMaker$1;->val$element:Lcom/nemustech/regina/ElementShortcut;

    invoke-virtual {v2}, Lcom/nemustech/regina/ElementShortcut;->getIcon()Landroid/graphics/drawable/Drawable;

    move-result-object v2

    iget-object v3, p0, Lcom/nemustech/regina/ElementMaker$1;->val$element:Lcom/nemustech/regina/ElementShortcut;

    invoke-virtual {v3}, Lcom/nemustech/regina/ElementShortcut;->getTitle()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lcom/nemustech/regina/ImagePlater;->createShortCutImage(Landroid/graphics/drawable/Drawable;Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v1

    goto :goto_0
.end method
